<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>个人信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/xadmin.css">
    <script type="text/javascript" src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>
    <script src="../js/base.js"></script>
    <script src="../js/jquery.min.js"></script>
    <script src="../js/vue.min.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .layui-col-md9 .layui-col-md4 {
            width: 258px;
            height: 257px;
            padding: 7px;
        }

        .layui-col-md9 .layui-col-md4 .item {
            width: 100%;
            height: 100%;
            background: #e4e4e4;
        }

        .personInfo {
            padding: 0 5px;
            float: left;
            height: 48px;
            display: -webkit-box;
            overflow: hidden;
            text-overflow: ellipsis;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }
    </style>
</head>

<body>

    <div class="layui-fluid" id="All_List">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card" style="display: flex;justify-content: space-between;">
                    <div class="layui-card-body " style="width: 100%;">
                        <div class="layui-col-md9">
                            <div class="layui-col-md4">
                                <div class="item" style=" background: #fff;border:2px solid #e4e4e4">
                                    <div class="layui-col-md5">
                                        <img :src="imgurl==null||imgurl==''?'../images/personal.png':imgurl" alt=""
                                            style="width: 94px;height: 120px;">
                                    </div>
                                    <div class="layui-col-md7">
                                        <div>姓名：{{name}}</div>
                                        <div>性别：{{sex}}</div>
                                        <div>出生日期：{{birthDay}}</div>
                                        <div>所属单位：{{identity}}</div>
                                        <div>所属部门：{{teamName}}</div>
                                    </div>
                                    <div class="personInfo">个人简介：{{introduction}}</div>
                                    <div @click="lookPerInfo"
                                        style="cursor: pointer;position: absolute;right: 5px;bottom: 5px;">
                                        查看全部信息 >>&emsp;
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md4">
                                <div class="item" style="text-align: center;">
                                    <div
                                        style="float: left;width: 70%;font-size: 18px;font-weight: 700;margin-top: 25px;">
                                        <img src="../images/jiangbei.png" style="width: 35px;height: 35px;" alt=""> 赛事总览
                                    </div>
                                    <a href="sign_up_list.html" v-if='typeName=="裁判员"'>
                                        <div style="float: left;width: 100%;margin-top: 5px;">
                                            <img src="../images/zzbm.png"
                                                style="width: 22px;height: 22px;  margin-right: 6px;margin-top: -3px;"
                                                alt="">正在报名赛事
                                            <span style="float: right;">{{caipan}}&emsp;&emsp;</span>
                                        </div>
                                    </a>

                                    <a href="myComInfo.html" v-if='typeName=="裁判员"'>
                                        <div style="float: left;width: 100%;margin-top: 5px;">
                                            <img src="../images/zzbm.png"
                                                style="width: 22px;height: 22px;  margin-right: 6px;margin-top: -3px;"
                                                alt="">被招募的赛事数量
                                            <span style="float: right;">{{zmNums}}&emsp;&emsp;</span>
                                        </div>
                                    </a>

                                    <a href="Team_list.html" v-if='typeName=="俱乐部"'>
                                        <div style="float: left;width: 100%;margin-top: 5px;">
                                            <img src="../images/zzbm.png"
                                                style="width: 22px;height: 22px;  margin-right: 6px;margin-top: -3px;"
                                                alt="">正在报名球队
                                            <span style="float: right;">{{qiudui}}&emsp;&emsp;</span>
                                        </div>
                                    </a>

                                    <a href="unapproved_list.html" v-if='personalOrGroup==2'>
                                        <div style="float: left;width: 100%;margin-top: 5px;">
                                            <img src="../images/zzbm.png"
                                                style="width: 22px;height: 22px;  margin-right: 6px;margin-top: -3px;"
                                                alt="">正在审核的赛事
                                            <span style="float: right;">{{comNums}}&emsp;&emsp;</span>
                                        </div>
                                    </a>

                                </div>
                            </div>
                            <!-- <div class="layui-col-md4">
                        <div class="item"></div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="item"></div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="item"></div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="item"></div>
                    </div> -->
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script>
    layui.use("layer", function () {
        var app = new Vue({
            el: "#All_List",
            data: {
                id: "",
                name: "",
                nickName: "",
                sex: "",
                birthDay: "",
                // workUnit: "",
                documentType: "",
                personalOrGroup: "",
                teamId: "",
                city: "",
                area: "",
                address: "",
                documentNumber: "",
                identity: "",
                caipan: "",
                qiudui: "",
                imgurl: "",
                typeName: "",
                teamName: "",
                introduction: "",
                comNums: '',
                zmNums: ''
            },
            methods: {
                index: function () {
                    var that = this
                    $.ajax({
                        url: findUserById,
                        type: 'post',
                        data: {},
                        dataType: 'json',
                        success: function (data) {
                            console.log(data)
                            if (data.msg == 0) {
                                that.name = data.user.name;
                                if (data.user.sex == "1") {
                                    that.sex = "男";
                                } else if (data.user.sex == "2") {
                                    that.sex = "女";
                                } else {
                                    that.sex = "";
                                }
                                that.nickName = data.user.nickName;
                                if (data.user.headPortraitUrl == null || data.user
                                    .headPortraitUrl == '') {
                                    that.imgurl = "../images/personal.png"
                                } else {
                                    that.imgurl = data.user.headPortraitUrl;
                                }
                                that.id = data.user.id;
                                that.birthDay = data.user.birthDay;
                                that.documentType = data.user.documentType;
                                that.documentNumber = data.user.documentNumber;
                                that.personalOrGroup = data.user.personalOrGroup;
                                that.address = data.user.address;
                                that.city = data.user.city;
                                that.area = data.user.area;
                                // that.workUnit = data.user.workUnit;
                                that.identity = data.user.identity;
                                that.teamId = data.user.teamId;

                                that.typeName = data.typeName;
                                that.teamName = data.user.teamName;
                                if (data.user.introduction) {
                                    that.introduction = data.user.introduction;
                                } else {
                                    that.introduction = "省足协单位社会发展部管理员，负责平台日常运营。";
                                }
                                if (data.user.personalOrGroup == 2) {
                                    $.ajax({
                                        url: getNewCompetitionListByOrgsId,
                                        type: 'post',
                                        data: {

                                        },
                                        dataType: 'json',
                                        success: function (res) {
                                            // that.comNums = 
                                            if (res.msg == 0) {
                                                that.comNums = res.count ?
                                                    res.count : 0
                                            }
                                        },
                                        error: function (res) {
                                            console.log(res)
                                        }
                                    })
                                }
                            } else if (data.msg != 0) {
                                if (data.msg == "2") {
                                    parent.window.location.href = getRequestPrefix() +
                                        "/footBallAdmin/login.html"
                                } else {
                                    layer.alert(data.msg, {
                                        title: '提示'
                                    })
                                }
                            }
                        },
                        error: function (data) {
                            console.log(data)
                            layer.alert(data.msg, {
                                title: '提示'
                            })
                        }
                    });
                    $.ajax({
                        url: getNewCompetitionListByUserId,
                        type: 'post',
                        data: {},
                        dataType: 'json',
                        success: function (data) {
                            console.log(data)
                            if (data.msg == 0) {
                                that.caipan = data.count;
                            } else if (data.msg != 0) {
                                if (data.msg == "2") {
                                    parent.window.location.href = getRequestPrefix() +
                                        "/footBallAdmin/login.html"
                                } else {
                                    layer.alert(data.msg, {
                                        title: '提示'
                                    })
                                }
                            }
                        },
                        error: function (data) {
                            console.log(data)
                            layer.alert(data.msg, {
                                title: '提示'
                            })
                        }
                    });
                    $.ajax({
                        url: getCountByRefereeId,
                        type: 'post',
                        data: {},
                        dataType: 'json',
                        success: function (res) {
                            if (res.msg == 0) {
                                that.zmNums = res.count ? res.count : 0;
                            } else if (res.msg != 0) {
                                if (res.msg == "2") {
                                    parent.window.location.href = getRequestPrefix() +
                                        "/footBallAdmin/login.html"
                                } else {
                                    layer.alert(res.msg, {
                                        title: '提示'
                                    })
                                }
                            }
                        }
                    })
                    $.ajax({
                        url: getNewCompetitionTeamListTeam,
                        type: 'post',
                        data: {},
                        dataType: 'json',
                        success: function (data) {
                            console.log(data)
                            if (data.msg == 0) {
                                that.qiudui = data.count;
                            } else if (data.msg != 0) {
                                if (data.msg == "2") {
                                    parent.window.location.href = getRequestPrefix() +
                                        "/footBallAdmin/login.html"
                                } else {
                                    layer.alert(data.msg, {
                                        title: '提示'
                                    })
                                }
                            }
                        },
                        error: function (data) {
                            console.log(data)
                            layer.alert(data.msg, {
                                title: '提示'
                            })
                        }
                    });
                },
                lookPerInfo: function () { //点击查看全部信息
                    var that = this
                    layer.open({
                        content: "lookPerInfo.html",
                        type: 2, //打开的窗口的类型
                        area: ["100%", "100%"],
                        title: "查看全部信息",
                        // btn: ['确认', '取消'],//开启显示按钮功能
                        // btnAlign: 'c',//居中显示按钮
                        // shade:true,
                        shadeClose: true,
                        success: function (layero, index) {
                            // console.log(data)//获取点击行的数据,获取打开的iframe
                            var body = layer.getChildFrame('body', index);
                            var iframeWin = window[layero.find('iframe')[0]['name']];
                            iframeWin.nickName = that.nickName
                            iframeWin.ID = that.id
                            body.find("#nickName").text(that.nickName)
                            iframeWin.name = that.name
                            body.find("#name").text(that.name)
                            iframeWin.sex = that.sex
                            body.find("#sex").text(that.sex)
                            iframeWin.birthDay = that.birthDay
                            body.find("#birthDay").text(that.birthDay)
                            if (that.personalOrGroup == 1) {
                                iframeWin.identity = that.identity
                                body.find("#identity").text(that.identity)
                                body.find(".identity").css("display", "block")
                                if (that.identity.indexOf("球员") !== -1) {
                                    iframeWin.teamName = that.teamName
                                    body.find("#teamName").text(that.teamName)
                                    body.find(".teamName").css("display", "block")
                                }
                            } else {
                                iframeWin.identity = "false"
                            }
                            if (that.documentType == 1) {
                                iframeWin.documentType = "1"
                                body.find("#documentType").text("身份证")
                            } else if (that.documentType == 2) {
                                iframeWin.documentType = "2"
                                body.find("#documentType").text("护照")
                            } else if (that.documentType == 3) {
                                iframeWin.documentType = "3"
                                body.find("#documentType").text("户口本")
                            }
                            iframeWin.documentNumber = that.documentNumber
                            body.find("#documentNumber").text(that.documentNumber)
                            iframeWin.address = that.address
                            body.find("#address").text(that.address)
                            iframeWin.city = that.city
                            body.find("#city").text(that.city)
                            iframeWin.area = that.area
                            body.find("#area").text(that.area)
                            iframeWin.introduction = that.introduction
                            body.find("#introduction").text(that.introduction)
                            iframeWin.headPhoto = that.imgurl
                            body.find("#headPhoto").attr("src", that.imgurl)
                            iframeWin.teamId = that.teamId
                        }
                    })
                }
            },
            created: function () {
                this.index()
            }
        })

    })
</script>

</html>